<template>
    <van-dialog v-model="visible" :title="title" :show-confirm-button="false">
       <div class="van-dialog__message van-dialog__message--has-title">
          {{ content }}
       </div>
        <div class="van-hairline--top van-dialog__footer van-dialog__footer--buttons">
            <button :disabled="disabled" @click="confirm(0)" class="van-button van-button--default van-button--large van-dialog__cancel">
                <span class="van-button__text">{{ left }}</span>
            </button>
            <button :disabled="disabled" @click="confirm(1)" class="van-button van-button--default van-button--large van-dialog__confirm van-hairline--left">
                <span class="van-button__text">{{ center }}</span>
            </button>
            <button :disabled="disabled" @click="confirm(2)" class="van-button van-button--default van-button--large van-dialog__confirm van-hairline--left">
                <span class="van-button__text">{{ right }}</span>
            </button>
        </div>
    </van-dialog>
</template>

<script>
  export default {
    name: "Confirmty",
    props:{
      title:{
        type:String,
        default:'提示',
        required:false
      },
      left:{
        type:String,
        default:'取消',
        required:false
      },
      center:{
        type:String,
        default:'保存草稿',
        required:false
      },
      right:{
        type:String,
        default:'发起流程',
        required:false
      },
      content:{
        type:String,
        default:'请确定操作?',
        required:false
      }
    },
    data(){
      return {
        visible:false,
        disabled:true
      }
    },
    methods:{
      show(){
        this.visible=true;
        this.disabled=false;
      },
      close(){
        this.visible=false;
      },
      confirm(flag){
        this.visible = false
        this.disabled=true;
        this.$emit('ok',flag);
      }
    }
  }


</script>

<style scoped>

</style>